package com.ifast.sys.service;

import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ExecutionException;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import com.baomidou.mybatisplus.plugins.Page;
import com.ifast.common.base.CoreService;
import com.ifast.common.domain.Tree;
import com.ifast.sys.domain.DeptDO;
import com.ifast.sys.domain.SysUserRole;
import com.ifast.sys.domain.UserDO;
import com.ifast.sys.vo.UserVO;
import com.luculent.util.extension.api.Result;

/**
 * <pre>
 * </pre>
 * 
 * <small> 2018年3月23日 | Aron</small>
 */
@Service("sysUserService")
public interface UserService extends CoreService<UserDO> {

    boolean exit(Map<String, Object> params);

    Set<String> listRoles(Long userId);

    int resetPwd(UserVO userVO, UserDO userDO);

    int adminResetPwd(UserVO userVO);

    Tree<DeptDO> getTree();

    /**
     * 更新个人信息
     * 
     * @param userDO
     * @return
     */
    int updatePersonal(UserDO userDO);

    /**
     * 更新个人图片
     * 
     * @param file
     *            图片
     * @param avatar_data
     *            裁剪信息
     * @param userId
     *            用户ID
     * @throws Exception
     */
    Map<String, Object> updatePersonalImg(MultipartFile file, String avatar_data, Long userId) throws Exception;
    
    /**
     * 干部保存角色信息
     * @param sysUserRole
     */
    void saveUserRole(SysUserRole sysUserRole);

    Result<?> getUserInfoForApp(String token);


    Result<?> updatePassword(String token, String oldPassword, String newPassword);


    Result<?> updateUserInfoZjForApp(String token,HttpServletRequest request) throws IOException;

    Result<?> forgetPassword(String code,String userName,String newPassWord) ;

    Page<UserDO> listPage(Page<UserDO> page, UserDO userDO);

    List<UserDO> listUser(UserDO userDO);

    Map<String,Integer> importUser(MultipartFile file,DeptDO deptDOCurr) throws ExecutionException, InterruptedException;

}
